package com.cloudcode.document;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.io.Serializable;
import java.util.List;

/**
 * @Author yunst
 */
@Data
@Document(indexName = "document_contents")
public class DocumentContent implements Serializable {
    /**
     * 文档id
     */
    @Id
    @Field(type = FieldType.Keyword)
    private Long id;

    /**
     * 文档内容
     */
//    @Field(type = FieldType.Text, analyzer = "ik_max_word")
    @Field(type = FieldType.Text, analyzer = "ik_smart")
    private String content;

    @Schema(description = "文档地址")
    @Field(type = FieldType.Keyword)
    private String path;

    @Schema(description = "图片")
    @Field(type = FieldType.Keyword)
    private String imgUrl;


    /**
     * 文档类型
     */
    @Field(type = FieldType.Integer)
    private Integer type;

    /**
     * 标题
     */
    @Field(type = FieldType.Text)
    private String title;
    /**
     * 创建时间
     */
    @Field(type = FieldType.Long)
    private Long createTime;
    /**
     * 更新时间
     */
    @Field(type = FieldType.Long)
    private Long updateTime;

    /**
     * 职业
     */
    @Field(type = FieldType.Keyword)
    private String career;


}
